package question2;

public class Car /*implements Comparable<Car> */{
    private String brand;
    private int price;
    private int number;

    public Car() {
    }

    public Car(String brand, int price, int number) {
        this.brand = brand;
        this.price = price;
        this.number = number;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                ", number=" + number +
                '}';
    }

    /*@Override
    public int compareTo(Car o) {
        return o.number-this.getNumber()==0?(o.price-this.getPrice()==0?this.brand.compareTo(o.getBrand()):o.price-this.getPrice()):o.number-this.getNumber();
    }*/
}
